package com.zjmzxfzhl.modules.purchase.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zjmzxfzhl.modules.purchase.controller.dto.PurchaseContractQueryDto;
import com.zjmzxfzhl.modules.purchase.controller.vo.PurchaseContractVo;
import com.zjmzxfzhl.modules.purchase.entity.PurchaseContract;
import com.zjmzxfzhl.modules.purchase.entity.PurchaseOrderDetail;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Mapper
 *
 * @author 庄金明
 */
public interface PurchaseContractMapper extends BaseMapper<PurchaseContract> {
    /**
     * 查询列表
     *
     * @param page
     * @param entity
     * @return
     */
    List<PurchaseContractVo> list(IPage<PurchaseContractVo> page, @Param("entity") PurchaseContractQueryDto entity);

    /**
     * 查找可合并得采购订单
     * @return
     */
    List<PurchaseOrderDetail> findMergeIndentInfo();

    /**
     * 查找需要合并的订单
     * @param orderId
     * @param supplierId
     * @return
     */
    List<Long> findNeedMergeIndent(@Param("orderId") Long orderId, @Param("supplierId") Long supplierId);
}
